﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_LargeFileMT : PX.ShowLayer.BaseView
{
	private PX.File.BigFileView clsBigFileView = new PX.File.BigFileView();
	private PX.User.UserComponent clsUserComp = new PX.User.UserComponent();
	private PX.FileMTRight.FileMTRightComponent clsFileMTRightComp = new PX.FileMTRight.FileMTRightComponent();
	private PX.Config _clsConfig = new PX.Config();

	public Admin_LargeFileMT()
		: base("idTotal")
	{
		clsView.Page = Page;

	}

	protected override void OnInit(EventArgs e)
	{

		PX.User.User clsLoginUser = new PX.User.User();
		PX.FileMTRight.FileMTRight clsFileMTRight = new PX.FileMTRight.FileMTRight();

		lBtnEdit.Visible = false;

		clsBigFileView.strRight = Session["LoginUserRight"].ToString();
		clsBigFileView.nUserID = Convert.ToInt32(Session["LoginUserID"]);
		clsBigFileView.nDepartmentID = Convert.ToInt32(Session["LoginUserDepartmentID"]);

		clsLoginUser = (PX.User.User) clsUserComp.GetOneByID(Convert.ToInt32(Session["LoginUserID"]));
		clsFileMTRight.Right = clsFileMTRightComp.QueryRight(clsLoginUser.UserGroupID);

		if (clsFileMTRight.Right == _clsConfig.nFileMTRight_All)
		{
			
		}
		else
		{
			if (clsFileMTRight.Right == _clsConfig.nFileMTRight_Department)
			{
				clsBigFileView.bQueryByDepartmentID = true;
			}
			else
			{
				clsBigFileView.bQueryByUserID = true;
			}
		}

		AddTableColumn(new Tony.Structs.TableShowColumn("文件名", "FileName"));
		AddTableColumn(new Tony.Structs.TableShowColumn("上传时间", "ShowDate"));
		AddTableColumn(new Tony.Structs.TableShowColumn("路径", "Path"));
		AddTableColumn(new Tony.Structs.TableShowColumn("栏目", "Column"));

		base.OnInit(e);
	}

	protected void Page_Load(object sender, EventArgs e)
	{

	}

	protected override Tony.ShowLayer.FormView GetViewType()
	{
		return clsBigFileView;
	}
}
